prove(polytime): close nontriviality certificate - #487
Conversation
🤖 PR Summary
This PR closes the three remaining nontriviality certificate gaps in the polynomial-time formalization. It provides a full proof of Statistics
Lean Declarations ✏️ Added: 37 declaration(s)
✅ Removed: 3 `sorry`(s)
📋 **Additional Analysis**Review Findings1. Attribution and File Headers
2. Documentation Expectations
3.
|
Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
4a4578d to
60cf6ad
Compare
|
Thanks for the proofs, much appreciated! Depending how much the underlying #481 draft changes before final review we can either merge this directly or I can rebase off these commits to preserve authorship if those changes end up breaking something here. |
|
Heads-up: #481, this PR's base, is being closed as a reference draft — upstream PolyFun replaced the |
|
The port has landed as #500: your closure of the three nontriviality cruxes is included (MachineCounting needed only the new |
- Charge the final readout in `detTotalTime`: the run's answer is `output (stepD^[steps] s)`, so the readout at the budget state is a real evaluation; `detTotalTime_le` and `exists_polynomial_detTotalTime_le` gain the matching term (closes the remaining #460 accounting bullet). - Derive `PolyTimeWitness.queryBound` as a theorem instead of a field: `ImplementsWithin` is the fuel-k unroll equality, whose bounded half is the total query bound (`implementsWithin_iff_implements_and_bound`; `IsTotalQueryBound` is definitionally `IsTotalRollBound`). All witness constructions shed the redundant proof obligation. - Pin `PolyTimeComputable.size` to the `Bool` alphabet: a bare state count only measures description size over a fixed alphabet, and only `Bool` is counted by `B`. - Drop the unused `PackedEncoding`/`boolify` layer (`Encoding.lean`) and the docstrings presenting it as the model's encoding source; import `Mathlib.Data.Nat.Bitwise` directly where its transitive import was load-bearing. - Generalize `exists_tmTable_of_card_le` to any `SingleTapeTM Bool`; add a real `OracleMachine.setInit` behind the `*_setInit` lemmas. - Refresh stale docstrings: retired names (`PolyTimeAdversary`, dead lemma references), sorry-era prose in `PolyTimeNontrivial`, nonexistent module references; state non-uniformity (P/poly) on `IsPolyTime`; warn against polynomial-depth `comp` iteration; credit Elias Judin in the headers of the two re-extracted #487 files. Co-authored-by: Elias Judin <ejudin@gmail.com> Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Aristotle-generated closure of the three isolated nontriviality-certificate gaps, with the accepted proof artifacts and local validation recorded in the branch.
The sole commit is explicitly co-authored with Aristotle (Harmonic).